1. Field of Invention
The present invention relates to a device and method for processing video image. More particularly, the present invention relates to the device and method for decompressing the compressed video data of a video image in a system that uses a variable-length encoding method with a line-end-code.
2. Description of Related Art
Following the recent advance in computer technologies, computer systems have become part of our life. Through linking to the Internet, the newest information from the world can be obtained in your personal computer. In recent years, the quantity of information flowing through a computer network has increased tremendously. Beside the general alphanumeric data, other types of data such as voice and video image are transmitted in vast quantities. The favored gem of today's PC hobbyist and general users is the multimedia system. A multimedia system need to shuttle vast amount of voice and video data around, hence, whether to store or to transmit, these data must be compressed in order to save memory space and increase processing time. For a multimedia system, the system must also include some other functions such as the enlargement and contraction of images besides having the basic function of decompressing the compressed video data.
There are a number of methods for decompressing the compressed video data. For example, one conventional method is to target the decompression of one horizontal line at a time. In practice, the first line of compressed video data is decompressed first, before the decompression of the second line is executed, and so on processing sequentially from the top line down to the bottom line. The conventional formats for storing row compressed video data are shown in FIGS. 1 through 4. They are composed of two parts, namely, a first part for storing the number of pixels and a second part for storing the color of the pixels. The length for storing the number of pixels is variable, for example, ranging from occupying 2-bits up to 14-bits as shown in FIGS. 1 through 4. On the other hand, the length for storing the color of the pixels is fixed, normally occupies just two bits. Therefore, when information from these two parts is obtained the number of pixels and its color in the horizontal direction is completely specified. By receiving and then decompressing the row compressed video data piece by piece in a left to right manner before reaching the line-end-code, the complete pixel image in a horizontal line is thus obtained. The line-end-code is very similar in format to the row compressed video data as shown in FIG. 5, except that the first part is of fixed length and all consists of zeros; while the second part stores the color of the pixels. When the receiver picks up the line-end-code, it will interpret to mean that the horizontal pixels from that point on are of the same color as specified in the color part of the line-end-code. The receiving of a line-end-code implies the end of a line, and therefore, anything received thereafter represent the code for the next line down. Again, decompression starts from the left side in a sequential order until the line-end-code is again received. The whole process is repeated many times from top to bottom line by line to form a decompressed data into a video image.
To enlarge or contract video images, the conventional method is to receive the whole packet of compressed video data, decompress it before applying the enlargement or contraction to create the actual image. As mentioned before, a large storage area is required to store up the decompressed video data; hence, a large capacity storage buffer is needed. This represents a waste in the memory storage space. At present, although the memory capacity of a dynamic random access memory (DRAM) chip is large and unit cost of it is rather cheap, DRAM chips are by no means cheap. Moreover, time is also wasted in writing a large quantity of data to a DRAM chip and then reading it from the DRAM chip for processing. In other words, the conventional method of processing image data is uneconomical.
In light of the foregoing, there is a need to provide devices and improved method for decompressing video image data.